< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03100500.xhp

(section: cint) (bookmark: bm_id3149346)
CInt function

CInt 関数

CInt Function [Runtime]
CInt 関数 [実行時](hd_id3149346.1)

Converts any string or numeric expression to an integer.
文字列および数値表式を、整数値に変換します。(par_id3155419.2)

(/section: cint)

Syntax:
構文:(hd_id3147573.3)

CInt (Expression)
CInt (Expression)(par_id3154142.4)

Return value:
戻り値:(hd_id3147531.5)

Integer
整数(par_id3147560.6)

Parameters:
パラメータ:(hd_id3145069.7)

Expression: Any numeric expression that you want to convert. If the Expression exceeds the value range between -32768 and 32767, Office Basic reports an overflow error. To convert a string expression, the number must be entered as normal text ("123.5") using the default number format of your operating system.
Expression: 変換させる数値表式。Expression の値が -32768 から 32767 の範囲に収まらない場合、Office Basic はオーバーフローエラーを出します。また文字列を変換する場合は、オペレーティングシステムが標準で使用する数の書式 (「123.5」など) でテキストを指定する必要があります。(par_id3159414.8)

This function always rounds the fractional part of a number to the nearest integer.
この関数で小数を変換すると、常に数値の小数部を丸めた整数値が返されます。(par_id3150358.9)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3145419.10)

Sub ExampleCountryConvert
Sub ExampleCountryConvert(par_id3150448.11)

Msgbox CDbl(1234.5678)
Msgbox CDbl(1234.5678)(par_id3156423.12)

Msgbox CInt(1234.5678)
Msgbox CInt(1234.5678)(par_id3150869.13)

Msgbox CLng(1234.5678)
Msgbox CLng(1234.5678)(par_id3153768.14)

end sub
end sub(par_id3145786.15)


< Prev / Next >